# 前置阶段2：该文档内存放可在上线前提前刷的脚本，但一定要支持增量刷新（上线时间段内增量数据的处理）

# 1 预收款余额表单的预收款余额字段刷解释，处理列表页汇总格式（加逗号）
# 回滚再次上线时，该步骤不需执行
# 编写者 徐俊杰
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456,"corpid": "1","userId": "1","corpidList": [],"platform": "web","saasMark": 1,"businessType": 712,"attr": "advancePaymentBalance","operate": 1}'

# 2 回款单ES数据处理（加回款单团队）
# 编写者 徐俊杰
# codeReview者 张传鹏
# 2.1 新建索引
# 索引参数为v1
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":702, "indexVersion": "v1"}'
# 2.2 把MySQL数据同步到ES
# 索引参数为v1
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":702,"byCorpid":0, "indexVersion": "v1"}'

# 3 付款单ES数据处理（加付款单团队）
# 编写者 徐俊杰
# codeReview者 张传鹏
# 3.1 新建索引
# 索引参数为v1
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":802, "indexVersion": "v1"}'
# 3.2 把MySQL数据同步到ES
# 索引参数为v1
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":802,"byCorpid":0, "indexVersion": "v1"}'

# 4 【kibana索引别名】为回/付款单新索引加别名，该步骤必须在kibana内执行，且要把前缀改为相应环境前缀
# 第一次使用别名，因此可以前置执行，且前置脚本内的资金账户相关脚本要用到新的索引
# 编写者 张传鹏
PUT /test2_idx_saas_payment_sheet_alias_v1/_alias/test2_idx_saas_payment_sheet_alias
PUT /test2_idx_saas_pay_sheet_alias_v1/_alias/test2_idx_saas_pay_sheet_alias

# 5 新建索引
# 5.1 预付款余额 新建索引
# 编写者 徐俊杰
# codeReview者
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":810}'

# 5.2 资金账户流水 新建索引
# 编写者 徐俊杰
# codeReview者
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":4900}'

# 5.3 进项发票 新建索引
# 编写者 zcp
# codeReview者
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":903}'

# 6 新增付款计划的坏账、开票金额脚本，可以提前刷数据,需要做增量刷-置0
# 编写者 陈山
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/scriptPayPlanData -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"801","endTime":"1590750000"}'

# 7 新增采购合同的坏账金额、实付金额、未付金额、付款比例、开票金额、未开票金额脚本，可以提前刷数据,需要做增量刷-置0
# 编写者 陈山
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/scriptPurchaseData -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"801","noInit":1,"endTime":"1590750000"}'

# 8 初始化公司资金账户
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/init/fund/account -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":0}'

# 9 初始化回款单资金账户字段
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/init/paymentSheet/account -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":0}'

# 10 审批中回款单数据处理(资金账户ID)
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/process/paymentSheet/initProcess/account -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":0}'

# 11 生成资金流水数据
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/init/fund/log -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":0}'

# 12 回款单关联合同、关联回款计划异常格式处理（该脚本只要上线前执行过一次，则回滚后再次上线，不需再次执行）
# 编写者 zcp
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/sheet/paymentSheet/exception/format -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456}'
